<#include "sshdXqListTemplate.html">
<#macro xmtopic>
${matchProject.matName!} 
</#macro>
<#macro toolbarButton> 
<style>
.xm_button .el-button1{
	background-color: #FDBF19;
	border-color: #FDBF19;
}
.xm_button .el-button2{
	background-color: #FF6F00;
	border-color: #FF6F00;
}
.xm_button img {margin-right: 6px;width: 20px;}
</style>
<button  type="button" class="el-button1" onclick="reflushWindow(true);"><span style="font-size: 16px;"><img class="btn_img" src="static/cms/www/default/img/sshd/shuaxin2.png"/>刷新</span></button>
<button  type="button" class="el-button2" onclick="downLoadXxXmExcel()"><span style="font-size: 16px;"><img class="btn_img" src="static/cms/www/default/img/sshd/daochu2.png"/>导出excel</span></button>
</#macro>
<#macro toolbarSearch>
<style>
.xm_search {
    padding: 20px;
    width: 1200px;
}
.xm_search .el-input__inner {
    background-color: #fff;
    background-image: none;
    border: 1px solid #d7e5ea;
    color: #1f2d3d;
    height: 35px;
    padding-left: 10px;
    width: 105px;
    font-size: 15px;
    border-radius: 5px;
}
.xm_search .txt_span{
    font-size:16px;
}
.xm_search .input_span{
    margin-left: 15px;
    margin-right: 15px;
}
.container1100 table.gridtable th{
	    width: 200px;
    padding-left: 10px;
}
.team_grid11{
	height: 450px;
    overflow-y: scroll;
}
.container1100 .team_grid11 table.gridtable td{
    width: 200px;
    padding-left: 10px;
}
</style>
<form id="searchXmForm">
<span class="txt_span">单位名称:</span>
<span class="input_span">
	<select  class="el-input__inner" name="xmCompanyName"  onchange="queryByCompanyName(this.options[this.options.selectedIndex].value)">
		<option value ="">全部</option>
	<#list companyList as type>
  		<option value ="${type.value!}"  <#if xmCompanyName?? && type.value == xmCompanyName> selected </#if> >${type.name!}</option>
	</#list>  
	</select>
</span>	
</form>
</#macro>
<#macro tableDataList>
    <tbody>
 <#if dataList??>
  <#list dataList as data>
    <tr>  
	    <td name="xmId" class="g_checkbox" style="display:none"><input name="schoolName" type="checkbox" value="${data.id!}"></input></td>
	    <td><@jmax.dc key="MATCH_COMPANY_INFO" code="${data.companyName!}" /></td> 
	    <td>${data.bmxmCount!0}</td>  
	    <td>${data.xxtjCount!0}</td>  
	    <td>${data.jsxmCount!0}</td>  
	    <td>
		<a onclick="showShcoolXm('${data.companyName!}')">[查看项目]</a>
		</td>  
	</tr>  
  </#list>
 </#if>
  </tbody>
</#macro>
<#macro contentListShow>
	<#include "sshdXqTable.html">
	<@createTable styleClass='container1100' tabfields = ['单位名称','报名项目数量','推荐项目数量','决赛项目数量','操作'] isCheckBox=false checkBoxName='schoolName' func=buttonOprator1  funcButton=buttonOprator1/>
	<div class="team_grid11"> 
		<@createTable styleClass='container1100' tabfields = [] isCheckBox=false checkBoxName='schoolName' func=tableDataList  funcButton=buttonOprator1/>
	</div>

</#macro>
<#macro buttonOprator1>
</#macro>
<#macro extendJs>
<script>
function queryByCompanyName(xmCompanyName) {
	var param = "&sshdId=${matchProject.id!}&xmCompanyName=" + xmCompanyName;
	window.location.href = "matchManager.do?sshdSysSchoolXm" + param;
}
function showShcoolXm(xmCompanyName) {
	window.open("matchManager.do?sshdSysScXmDetail&sshdId=${matchProject.id!}&xmCompanyName=" + xmCompanyName);
}
function searchXmByParam(formId) {
	var param = getFormParam(formId);

	var url = "matchManager.do?sshdSysSchoolXm&sshdId=${matchProject.id!}&pageNo=1";
	window.location.href = url  + param;
}


function getFormParam(formId) {
	var param = "";
	$("#" + formId + " input").each(function(){
		if(this.name == "xmName") {
			param = param + "&" + this.name + "=" + encodeURI(encodeURI(this.value));
		 } else {
		 	param = param + "&" + this.name + "=" + this.value;
		 }
	});	
	$("#" + formId + " select").each(function(){
		 param = param + "&" + this.name + "=" + this.value;
	});
	return param;
}

//导出excel
function downLoadXxXmExcel() {
// 	xmCompanyName
	var url = "matchManager.do?downLoadXxXm&sshdId=${matchProject.id!}"+getFormParam('searchXmForm');
	if($('#downloadForm')) $('#downloadForm').remove();
	var downloadForm  = $("<form id=\"downloadForm\">");//定义一个form表单
	downloadForm.attr("style","display:none");
	downloadForm.attr("target","");
	downloadForm.attr("method","post");
	downloadForm.attr("action",url);
	var input1=$("<input>");
	input1.attr("type","hidden");
	input1.attr("name","downLoad");
	input1.attr("value",(new Date()).getMilliseconds()); 
	$("body").append(downloadForm);//将表单放置在web中
	downloadForm.append(input1);
	downloadForm.submit();//表单提交
}
</script>
</#macro>